function userAllIn()
{
	if(userTurn) {
		continueGame();
	}
}

function userCall()
{
	if(userTurn) {
		makeCall(document.getElementById("user-" + USER_NUM), CALL);
		continueGame();
	}
}

function userFold()
{	
	if(userTurn) {
		continueGame();
	}
}


function makeCall(user, call) 
{
	var spanCollection = user.getElementsByTagName("span");
	for (i = 0; i < spanCollection.length; i++) {
			if(spanCollection[i].getAttribute("class") == "sum") {
				spanCollection[i].innerHTML = spanCollection[i].innerHTML - call;
			} else if(spanCollection[i].getAttribute("class") == "bid") {
				spanCollection[i].innerHTML = call;
			}
	}
	
	sum = parseInt(document.getElementById("pot").innerHTML);
	document.getElementById("pot").innerHTML = sum ? sum + call : call;
}

function makeAllIn(user) 
{
	var spanCollection = user.getElementsByTagName("span");
	var balance;
	for (i = 0; i < spanCollection.length; i++) {
		if(spanCollection[i].getAttribute("class") == "sum") {
			balance = spanCollection[i].innerHTML;
			spanCollection[i].innerHTML = 0;
		}
	}
	
	for (i = 0; i < spanCollection.length; i++) {
		if(spanCollection[i].getAttribute("class") == "bid") {
			spanCollection[i].innerHTML = balance;
		}
	}
	
	sum = parseInt(document.getElementById("pot").innerHTML);
	sum_2 = parseInt(balance);
	document.getElementById("pot").innerHTML = sum ? sum + (sum_2 ? sum_2 : 0) : (sum_2 ? sum_2 : 0);
}